#pragma once
#include "ASN1Encodable.h"

namespace AppliedCryptography
{
	namespace AC = AppliedCryptography;

	class ASN1ObjectIdentifier : public ASN1Encodable
	{
	private:
		std::string _value;

	protected:
		ASN1ObjectIdentifier(ClassBits classBits, ConstructedBit constucted, TypeNumberBits number);
		ASN1ObjectIdentifier(ClassBits classBits, ConstructedBit constucted, TypeNumberBits number, const std::string& value);
		ASN1ObjectIdentifier(ClassBits classBits, ConstructedBit constucted, TypeNumberBits number, const char* value);

	public:
		ASN1ObjectIdentifier();
		ASN1ObjectIdentifier(const std::string& value);
		ASN1ObjectIdentifier(const char* value);

	public:
		virtual void set(const std::string& value);
		virtual void set(const char* value);
		virtual void operator=(const std::string& value);
		virtual void operator=(const char* value);

	public:
		virtual std::string get() const;

	public:
		virtual std::vector<byte> getContentBits() const;

	private:
		std::vector<unsigned long> parseIdComponents() const;
		std::vector<byte> encodeComponents(unsigned long component) const;
	};
}; // namespace AppliedCryptography
